$(function () {
    var form = new xhForm($('#xh_form'));
    form.parse();
    $('[name=sMonth]').val(getNowMonth());
    $('#bt_modal_confirm' , parent.document).click(function () {
        if ($('[name=iGrade]').val() > 5) {
            window.top.xhTop.showError('错误','成绩不能大于5');
            xhExtra.setBtnNormal($(this));
            return false;
        }
        form.submit('school_share/saveGrade',{},function (res) {
            window.top.xhTop.showSuccess(res.msg);
            window.top.xhTop.closeModal();
        })
    })
});

function getNowMonth() {
    var date = new Date();
    var month = date.getMonth()+1 ;
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    return  date.getFullYear()+'-'+ month;
}